home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-09-14 | 3.8 KB | 142 lines | [TEXT/MPS ] |
- #
- # File: CheckedOutFiles
- #
- # Contains: script to echo names of files checked out modifiable in a project
- #
- # Usage: CheckedOutFiles [-project project | -m]
- #
- # Status: CheckedOutFiles may return the following status values:
- #
- # 0 success
- # 1 error
- #
- # Written by: scott douglass and Darin Adler
- #
- # Copyright: © 1988-1990 by Apple Computer, Inc., all rights reserved.
- #
- # Change History (most recent first):
- #
- # <9> 1/31/90 sad add quoting in FileVersInfo test
- # 12/6/89 sad better parsing of ProjectInfo
- # 11/15/89 dba fix comments
- # 11/13/89 sad redirect ProjectInfo not an author warnings
- # 11/9/89 dba twiddled relentlessly
- # 11/8/89 dba fix quoting in irrelevant ways
- # 8/7/89 sad fix no -project case
- # 7/20/89 sad add -project option
- # 5/26/89 sad change parsing of ProjectInfo output for new Shell
- # 2/17/89 sad written from CheckInAll
- #
- # To Do:
- # handle file names with spaces
- #
-
- Alias UsageError 'Alert "“{0} {Parameters}” doesn’t make sense.∂nUsage: “{0} [-project project | -m]”" ; Exit 1'
-
- Set Exit 0
-
- Begin
-
- Set Options ""
- Set Project ""
-
- If {#} == 2 && "{1}" =~ /-project/
- If {Options} == ""
- Set Options "-project"
- Set Project ∂""{2}∂""
- Else
- UsageError
- End
- Else If {#} == 1 && "{1}" =~ /-m/
- If {Options} == ""
- Set Options "-m"
- Else
- UsageError
- End
- Else If {#} ≠ 0
- UsageError
- End
-
- # first get all the check-out directories for the current project
-
- Set CheckOutDirs "`CheckOutDir -r {Options} {Project}; Set CheckOutDirStatus {Status}; Echo`"
- If {CheckOutDirStatus}
- Echo "### {0} - CheckOutDir failed." > Dev:StdErr
- Exit 1
- End
-
- Loop
- Break If "{CheckOutDirs}" !~ / *CheckOutDir +-project ∂'«0,1»([¬:]+∫)®1∂'«0,1» ∂'«0,1»([¬∫]*:)®2∂'«0,1» (≈)®3/
- Set Project "{®1}"
- Set CheckOutDir "{®2}"
- Set CheckOutDirs "{®3}"
-
- # now for each directory, get all modified files in the project
-
- Set Info "`ProjectInfo -s -a "{User}" -m -project "{Project}" ≥ Dev:Null; Set ProjectInfoStatus {Status}`"
- If {ProjectInfoStatus}
- Echo "### {0} - ProjectInfo of “{Project}” failed." > Dev:StdErr
- Exit 1
- End
-
- Continue If "{Info}" == ""
-
- If "{Info}" =~ /∂'«0,1»?+∫∂'«0,1»(≈)®1/
- Set Info "{®1}"
- Else
- Echo "### {0} - Couldn’t parse Info: “{Info}”" > Dev:StdErr
- Exit 1
- End
-
- Loop
- Break If "{Info}" !~ /[¬+]* «0,1»∂'([¬,]+)®1,([0-9.a-z]+∂+)®2∂' (≈)®3/
- Set ProjectFileName "{®1}"
- Set ProjectVersInfo "{®2}"
- Set Info "{®3}"
-
- Set DirFile "{CheckOutDir}{ProjectFileName}"
-
- If `Exists "{DirFile}"`"" ≠ ""
- Quote "{DirFile}"
-
- Begin
- Set FileInfo "`ProjectInfo "{DirFile}"`"
- If "{FileInfo}" =~ /∂'«0,1»([¬,]+)®1,([0-9.a-z]+[+*]«0,1»)®2∂'«0,1»( WARNING: this file has been renamed!)«0,1»≈Project: ([¬:]+∫)®5 Checked out: ≈/
- Set FileFileName "{®1}"
- Set FileVersInfo "{®2}"
- Set VersInfo "({FileVersInfo} vs {ProjectVersInfo})"
- Set FileProject "{®5}"
-
- # If `RelString "{FileProject}" "{Project}"` ≠ 0
- If "{FileProject}" ≠ "{Project}"
- Echo -n "### "
- Quote -n File "{DirFile}"
- Echo " is in the wrong project (“{FileProject}” vs “{Project}”)"
- Else If "{FileVersInfo}" ≠ "{FileVersInfo}"
- Echo -n "### "
- Quote -n File "{DirFile}"
- Echo " is wrong version ({FileVersInfo} vs {ProjectVersInfo})"
- End
- Else
- Echo "### {0} - Couldn’t parse FileInfo: “{FileInfo}”"
- Exit 1
- End
- End > Dev:StdErr
- Else
- Echo -n "### "
- Quote -n File "{ProjectFileName}"
- Echo " is checked out from “{Project}” but not in the directory “{CheckOutDir}”." > Dev:StdErr
- End
- End
- If "{Info}" ≠ ""
- Echo "### {0} - Couldn’t parse Info: {Info}" > Dev:StdErr
- Exit 1
- End
- End
- If "{CheckOutDirs}" ≠ ""
- Echo "### {0} - Couldn’t parse CheckOutDirs: {CheckOutDirs}" > Dev:StdErr
- Exit 1
- End
-
- End
-